﻿/*
using UnityEngine;

namespace CWM.Skinn
{
    public static partial class SkinnContextCommands
    {
      
        [CtxMenuItem("Renderer/Clipboard/Paste/Blend-shapes LOD",
            "Pastes blend-shapes from one skinned mesh renderer to another, existing blend-shapes will be skipped. " +
            "Requirements: " +
            "Matching sub-mesh count and order. " +
            "No Overlapping UV layouts per sub-mesh. ",
             ContextFlag.PasteFunction, 001)]
        public static void RendererPasteBlendshapesLOD()
        {
            var item = SkinnContext.GetContextItem();
            if (item && SkinnEx.IsNullOrNotInAScene(item.transform)) return;
            var context = item.GetComponent<Renderer>();
            if (SkinnEx.IsNullOrNotVailid(context)) return;

            var copyContext = (Renderer)SkinnContext.CopyRef.Asset;
            if (SkinnEx.IsNullOrNotVailid(copyContext)) return;

            var mesh = context.GetSharedMesh().Clone() as Mesh;
            if (!mesh.CopyBlendshapesLOD(copyContext.GetSharedMesh()))
            {
                Debug.LogWarning("Paste Blendshapes Failed.");
            }
            else
            {
                SkinnContext.UndoRecord(context, "Paste Blend-shapes LOD");
                context.SetSharedMesh(mesh);
            }

            SkinnContext.Finished();
        }

        [CtxMenuItem("Renderer/Clipboard/Paste/Blend-shapes VM",
            "Pastes blend-shapes from one skinned mesh renderer to another, existing blend-shapes will be skipped. ",
             ContextFlag.PasteFunction, 001)]
        public static void RendererPasteBlendshapesVM()
        {
            var item = SkinnContext.GetContextItem();
            if (item && SkinnEx.IsNullOrNotInAScene(item.transform)) return;
            var context = item.GetComponent<Renderer>();
            if (SkinnEx.IsNullOrNotVailid(context)) return;

            var copyContext = (Renderer)SkinnContext.CopyRef.Asset;
            if (SkinnEx.IsNullOrNotVailid(copyContext)) return;

            SkinnContext.UndoRecord(context, "Paste Blend-shapes VM");
            if (!SkinnEx.CopyBlendshapesVM(context as SkinnedMeshRenderer, copyContext as SkinnedMeshRenderer))
            {
                Debug.LogWarning("Paste Blendshapes VM Failed.");
            }

            SkinnContext.Finished();
        }
    }
}
*/